package com.lcj.odr.service;

import com.lcj.common.util.PageUtils;
import com.lcj.odr.controller.form.DriverIdForm;
import com.lcj.odr.db.pojo.OrderBillEntity;
import com.lcj.odr.db.pojo.OrderEntity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author : lcj
 * @create 2022/11/16 10:20
 */
public interface OrderService {

    /**
     * 分页查询订单和评价
     * @param param
     * @return
     */
    PageUtils searchOrderAndCommentByPage(Map param);

    /**
     * 更新订单关于支付
     * @param param
     * @return
     */
    String updateOrderAboutPayment(Map param);

    /**
     * 校验是否能支付此订单
     * @param param
     * @return
     */
    HashMap validCanPayOrder(Map param);

    int updateOrderPrepayId(Map param);

    /**
     * 查询司机首页信息
     * @param driverId
     * @return
     */
    HashMap searchDriverTodayBusinessData(long driverId);

    /**
     * 添加订单
     * @param orderEntity
     * @param billEntity
     * @return 订单ID
     */
    String insertOrder(OrderEntity orderEntity, OrderBillEntity billEntity);

    /**
     * 司机强单
     * @param driverId
     * @param orderId
     * @return
     */
    String acceptNewOrder(long driverId, long orderId);

    /**
     * 查询执行订单
     * @param param
     * @return
     */
    HashMap searchDriverExecuteOrder(Map param);

    /**
     * 查询订单状态
     * @param param
     * @return
     */
    Integer searchOrderStatus(Map param);

    /**
     * 删除未接单订单
     * @param param
     * @return
     */
    String deleteUnAcceptOrder(Map param);

    /**
     * 查询司机当前订单
     * @param driverId
     * @return
     */
    HashMap searchDriverCurrentOrder(long driverId);

    /**
     * 查询乘客当前订单
     * @param customerId
     * @return
     */
    HashMap hasCustomerCurrentOrder(long customerId);

    /**
     * 查询订单
     * @param param
     * @return
     */
    HashMap searchOrderForMoveById(Map param);

    /**
     * 司机到达接送点
     * @param param
     * @return
     */
    int arriveStartPlace(Map param);

    /**
     * 确认司机到达出发点
     * @param orderId
     * @return
     */
    boolean confirmArriveStartPlace(long orderId);

    /**
     * 确认开始驾驶
     * @param param
     * @return
     */
    int startDriving(Map param);

    /**
     * 更新订单状态
     * @param param
     * @return
     */
    int updateOrderStatus(Map param);

    PageUtils searchOrderByPage(Map param);

    /**
     * 查询司机详细信息
     * @param orderId
     * @return Order detail
     */
    HashMap searchOrderContent(long orderId);

    /**
     * 查询n日内上车点
     * @return
     */
    ArrayList<HashMap> searchOrderStartLocationIn30Days();

    /**
     * 查出司机是否属于该订单
     * @param param
     * @return
     */
    boolean validDriverOwnOrder(Map param);

    /**
     * 查询计算费用所需字段
     * @param orderId
     * @return
     */
    HashMap searchSettlementNeedData(long orderId);

    /**
     * 查询订单和账单信息
     * @param param
     * @return
     */
    HashMap searchOrderById(Map param);

    /**
     * 查询订单司机
     * @param orderId
     * @return
     */
    String searchOrderDriver(long orderId);

    /**
     * 处理支付流程
     * @param orderId
     * @param payId
     * @param driverOpenId
     * @param payTime
     */
    void handlePayment(Long orderId, String payId, String driverOpenId, String payTime);

    /**
     * 查询司机本周接单数
     * @param form
     * @return
     */
    Long searchOrderWeekNumber(DriverIdForm form);

    /**
     * 查询司机总接单数
     * @param form
     * @return
     */
    Long searchOrderTotalNumber(DriverIdForm form);
}
